package com.aiyige.model.eshop;

import java.util.List;

/**
 * 创建订单所需要的参数
 *
 */
public class OrderCreateModel {


//    String source;//	购买来源	是	[string]	app

    String sourceUrl;//	购买来源URL，域名地址	是	[string]	http://test.everygod.com

    String sellerId;//	卖家id	是	[string]	ff808081613063be0161307482f40002

    List<ProductsBackup> productsBackup;//	商品列表信息	是	[array]

//    String momenId;//	动态id	是	[string]	402881cd61846af401618470dc2c0000
//
//    Integer count;//	购买数量	是	[int]	1

    String subject;//	动态主题	是	[string]

    int version;

    List<String> userCouponIds;

    private OrderCreateModel(Builder builder) {
        setSourceUrl(builder.sourceUrl);
        setSellerId(builder.sellerId);
        setProductsBackup(builder.productsBackup);
        setSubject(builder.subject);
        setVersion(builder.version);
        userCouponIds = builder.userCouponIds;
    }

    public static Builder newBuilder() {
        return new Builder();
    }


    public String getSourceUrl() {
        return sourceUrl;
    }

    public void setSourceUrl(String sourceUrl) {
        this.sourceUrl = sourceUrl;
    }

    public String getSellerId() {
        return sellerId;
    }

    public void setSellerId(String sellerId) {
        this.sellerId = sellerId;
    }

    public List<ProductsBackup> getProductsBackup() {
        return productsBackup;
    }

    public void setProductsBackup(List<ProductsBackup> productsBackup) {
        this.productsBackup = productsBackup;
    }



    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }


    public static final class Builder {
        private String sourceUrl;
        private String sellerId;
        private List<ProductsBackup> productsBackup;
        private String subject;
        private int version;
        private List<String> userCouponIds;

        private Builder() {
        }

        public Builder sourceUrl(String val) {
            sourceUrl = val;
            return this;
        }

        public Builder sellerId(String val) {
            sellerId = val;
            return this;
        }

        public Builder productsBackup(List<ProductsBackup> val) {
            productsBackup = val;
            return this;
        }

        public Builder subject(String val) {
            subject = val;
            return this;
        }

        public Builder version(int val) {
            version = val;
            return this;
        }

        public Builder userCouponIds(List<String> val) {
            userCouponIds = val;
            return this;
        }

        public OrderCreateModel build() {
            return new OrderCreateModel(this);
        }
    }
}
